<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <title>操作页面</title>
 <link rel="stylesheet" href="<%=basePath%>node_modules/bootstrap/dist/css/bootstrap.min.css">
 <link rel="stylesheet" href="<%=basePath%>css/findLogs.css">
 <script>
  function toProjectHistory(id) {
       location.href="toProjectHistory/"+id;
  }
 </script>
</head>
<body>
<h3>操作记录表</h3>
<div class="return">
 <a class="out" href="showAll" >返回</a>
</div>
<form id="form1">
 <table border="1px">
  <input type="hidden" name="pageNo" id="pageNo" value="${list.pageNo}"/>
  <input type="hidden" name="setPageSize" id="setPageSize" value="${list.pageSize}"/>
  <table class="table table-hover">
       <tr class="t_head">
        <td>序号</td>
        <td>负责人</td>
        <td>操作日志</td>
        <td>日期</td>
       </tr>
       <c:forEach var="c" items="${list.data}" >
        <tr>
         <td>${c.id}</td>
         <td>${c.name}</td>
         <td>${c.message} <c:if test="${fn:indexOf(c.message,'更新项目')!=-1}">&nbsp;&nbsp;<a onclick="javaScript:toProjectHistory(${c.id})">详情请点击</a> </c:if></td>
         <td><fmt:formatDate value="${c.update_time}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
        </tr>
  </c:forEach>
 </table>
</form>

<!-- 引入分页 -->
<jsp:include page="page.jsp" flush="true">
 <jsp:param name="" value=""/>
</jsp:include>


<script type="text/javascript">
    function gotoPage(pageNo) {
        if(pageNo==0){
            document.getElementById("pageNo").value = document.getElementById("inputPage").value;
            document.getElementById("setPageSize").value = document.getElementById("getPageSize").value;
        }else {
            document.getElementById("pageNo").value = pageNo;
        }
        var forms = document.getElementById("form1");
        forms.action = "findLogs";
        forms.submit();
    }
</script>
</body>
<script src="<%=basePath%><%=basePath%>node_modules/jquery/dist/jquery.min.js"></script>
<script src="<%=basePath%><%=basePath%>node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
</html>